<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/bootstrap4/css/bootstrap.css">
    <script src="${pageContext.request.contextPath}/resource/js/jquery-3.2.1.js"></script>
    <script src="${pageContext.request.contextPath}/resource/bootstrap4/js/bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/resource/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
    <form>
        <input type="hidden" name="pageNum" value="${arg.pageNum}">
    </form>
    <button type="button" onclick="location='${pageContext.request.contextPath}/resume/toInsert'">添加</button>
    <button type="button" onclick="location='${pageContext.request.contextPath}/desire/list'">意象整理</button>
    <hr>
    <table class="table">
        <tr>
            <td>id</td>
            <td>名称</td>
            <td>求职意向</td>
            <td>学历</td>
            <td>手机</td>
            <td>邮箱</td>
        </tr>
        <c:forEach items="${list.list}" var="r">
            <tr>
                <td>${r.id}</td>
                <td>${r.name}</td>
                <td>
                    <c:forEach items="${r.desires}" var="d" varStatus="i">
                        ${d.name}
                        <c:if test="${i.last==false}">,</c:if>
                    </c:forEach>
                </td>
                <td>${r.education.education}</td>
                <td>${r.phoneNum}</td>
                <td>${r.email}</td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="100">
                <c:forEach items="${list.navigatepageNums}" var="page">
                    <button type="button" onclick="goPage(${page})">${page}</button>
                </c:forEach>
            </td>
        </tr>
    </table>
    <script>
        $(function () {

        });
        function goPage(pageNum) {
            $("[name='pageNum']").val(pageNum);
            sub();
        }
        function sub() {
            location = "${pageContext.request.contextPath}/resume/list?"+$("form").serialize();
        }

    </script>
</body>
</html>
